//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.yuebanmaoshare.file.common.exception;

import com.yuebanmaoshare.file.common.result.ResultCodeEnum;

public class YuebanmaoException extends RuntimeException {
    private Integer code;

    public YuebanmaoException(String message) {
        super(message);
        this.code = ResultCodeEnum.UNKNOWN_ERROR.getCode();
    }

    public YuebanmaoException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public YuebanmaoException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    public String toString() {
        return "YuebanmaoException{code=" + this.code + ", message=" + this.getMessage() + '}';
    }

    public Integer getCode() {
        return this.code;
    }

    public void setCode(final Integer code) {
        this.code = code;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof YuebanmaoException)) {
            return false;
        } else {
            YuebanmaoException other = (YuebanmaoException)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$code = this.getCode();
                Object other$code = other.getCode();
                if (this$code == null) {
                    if (other$code != null) {
                        return false;
                    }
                } else if (!this$code.equals(other$code)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof YuebanmaoException;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $code = this.getCode();
        result = result * 59 + ($code == null ? 43 : $code.hashCode());
        return result;
    }
}
